package jtk.project4.fleet.screen.tireassigment;

import java.awt.FlowLayout;
import nl.coderight.jazz.action.Action;
//import nl.coderight.jazz.dialog.MessageType;
//import nl.coderight.jazz.dialog.OptionDialog;
//import nl.coderight.jazz.dialog.OptionType;
//import nl.coderight.jazz.dialog.ReturnOptionType;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormField;
import nl.coderight.jazz.form.FormHeader;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
//import nl.coderight.jazz.form.control.TabControl;
//import nl.coderight.jazz.form.control.TabItem;
import nl.coderight.jazz.form.field.button.PushButton;
//import nl.coderight.jazz.form.validation.ValidationError;

import jtk.project4.fleet.action.CancelAction;
//import jtk.project4.fleet.action.SaveAction;
import jtk.project4.fleet.event.TireAssigmentEvent;
import jtk.project4.fleet.field.*;


public class TireAssigmentView extends FormView{
	private PushButton saveButton ;
	private PushButton cancelButton ;
	private PushButton resetButton;
	private PushButton helpButton;
	private FormHeader formHeader ;
	
	@Override
	protected void init() {
		createFields();
		createLayout();
		
	}
	
	private void createLayout() {
		addField(createForm());
	}
	private void createFields(){
		saveButton = new PushButton("submitAction");
		cancelButton = new PushButton("cancelAction");
	}
	
	private FormHeader createHeader() {
		formHeader = new FormHeader();
		formHeader.setTitle("Tire Assigment");
		return formHeader;
	}
	
	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(saveButton);
		buttons.addField(cancelButton);
		return buttons;
	}
	
	private FormField createForm() {
		GroupControl form = new GroupControl();
		setLayout(new FormLayout())
		.addField(new TireLayoutField("Tire Layout"))
		.addRow()
		.addField(new TireInfoField(""))
		.addRow()
		.addField(new LaborDetailField("Labor Details"))
		//form.addField(new ContohSpinnerField("domains"), CENTER);
		//form.addField(new ContohRadioButtonField("domains"), CENTER);
		//form.addField(new ContohCheckField("domain"),CENTER);
		.addRow()
		.addField(createButtons());				
		return form;
}
}